<?php

namespace adibilis\adminBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ActiviteType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('reference',   'text', array('label' => 'Référence'))
            ->add('name',     'text', array('label' => "Nom de l'activité"))
            ->add('description',      'textarea' , array(  'required' => false))
            ->add('descriptionen',      'textarea' , array( 'label' => "Description (Anglais)",  'required' => false))
            ->add('descriptionde',      'textarea' , array( 'label' => "Description (Allemand)",  'required' => false))
            ->add('address', 'textarea', array('label' => 'Adresse'))
            ->add('telephone', 'text', array('label' => 'No de téléphone'))
            ->add('email', 'text', array('label' => 'Adresse e-mail'))


            ->add('image',        new ImageType(), array('required' => false)) 

            ->add('categories', 'entity', array(
                  'class'    => 'adibilisadminBundle:Category',
                  'property' => 'name',
                  'expanded' => true,
                  'multiple' => true))


            ->add('criterias', 'entity', array(
                  'class'    => 'adibilisadminBundle:Criteria',
                  'property' => 'name',
                  'expanded' => true,
                  'multiple' => true))

            ->add('locality', 'entity', array(
                  'class'    => 'adibilisadminBundle:Locality',
                  'property' => 'locality',
                  'label' => 'Localité'))

            ->add('active',  'checkbox', array('required' => false, 'label' => 'Actif'))


            

            ->add('latitude', 'hidden')
            ->add('longitude', 'hidden')
                ;



                
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'adibilis\adminBundle\Entity\Activite'
        ));
    }

    public function getName()
    {
        return 'adibilis_adminbundle_activitetype';
    }
}
